/**
 * @description: 校验网络请求码
 * @param {number} status
 * @return {*}
 */
export const checkStatus = (status: number): void => {
  switch (status) {
    case 400:
      uni.showToast({
        title: '请求失败！请您稍后再试',
        icon: 'none',
        duration: 2000,
      })
      break
    case 401:
      uni.showToast({
        title: '登录失效！请您重新登录',
        icon: 'none',
        duration: 2000,
      })
      uni.reLaunch({
        url: '/pages/login/login',
      })
      break
    case 403:
      uni.showToast({
        title: '当前账号无权限访问！',
        icon: 'none',
        duration: 2000,
      })
      break
    case 404:
      uni.showToast({
        title: '你所访问的资源不存在！',
        icon: 'none',
        duration: 2000,
      })
      break
    case 405:
      uni.showToast({
        title: '请求方式错误！请您稍后重试',
        icon: 'none',
        duration: 2000,
      })
      break
    case 408:
      uni.showToast({
        title: '请求超时！请您稍后重试',
        icon: 'none',
        duration: 2000,
      })
      break
    case 500:
      uni.showToast({
        title: '服务异常！',
        icon: 'none',
        duration: 2000,
      })
      break
    case 502:
      uni.showToast({
        title: '网关错误！',
        icon: 'none',
        duration: 2000,
      })
      break
    case 503:
      uni.showToast({
        title: '服务不可用！',
        icon: 'none',
        duration: 2000,
      })
      break
    case 504:
      uni.showToast({
        title: '网关超时！',
        icon: 'none',
        duration: 2000,
      })
      break
    default:
      uni.showToast({
        title: '请求失败！',
        icon: 'none',
        duration: 2000,
      })
  }
}
/**
 * @autoAdd: true
 * @description:
 * @event:
 * @return {*}
 */
